package com.sxpi.zixun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sxpi.zixun.pojo.AdminRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: 董伟豪
 * @Date: 2022/8/25 11:05
 */
public interface AdminRoleMapper extends BaseMapper<AdminRole> {

    /**
     * 查询角色对应的权限
     * @param roleId
     * @return
     */
    List<String> findPermissionByRoleId(@Param("roleId")Long roleId);

    /**
     * 删除角色对应的权限
     * @param roleId
     * @return
     */
    int deletePermissionByRoleId(@Param("roleId")Long roleId);

    /**
     * 给角色授权
     * @param roleId
     * @param permissionId
     * @return
     */
    int savePermissionByRoleId(@Param("roleId")Long roleId,@Param("permissionId")Long permissionId);

}
